<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/

$onlymine=$_REQUEST['onlymine'];
if($onlymine == 'true') {
    $mine_selected = ' selected="selected"';
    $all_selected = '';
} else {
    $mine_selected = '';
    $all_selected = ' selected="selected"';
}
?>
   	<div class="left">
      	<span class="lvtHeaderText"><?php echo getTranslatedString('LBL_NOTES_INFORMATION');?></span>
      </div>
   	<div class="right">
         <?php
   	      $allow_all = $client->call('show_all',array('Documents'),$Server_Path, $Server_Path);
   	      if($allow_all == 'true'){
   	         echo '<span class="right">' . getTranslatedString('SHOW') . '</span>
   	         <select name="list_type" onchange="getList(this, \'Documents\');">
      	 			<option value="mine"'. $mine_selected .'>'.getTranslatedString('MINE').'</option>
      				<option value="all"'. $all_selected .'>'.getTranslatedString('ALL').'</option>
   				</select>' . "\n";
   	    	}
         ?>
    	</div>
   </form>
</div><!-- End action -->
<?php
global $result;
global $client;

echo '<table class="list">' . "\n";

if ($customerid != '' )
{
	$block = "Documents";
	$params = array('id' => "$customerid", 'block'=>"$block",'sessionid'=>$sessionid,'onlymine'=>$onlymine);
	$result = $client->call('get_list_values', $params, $Server_Path, $Server_Path);
	echo getblock_fieldlistview($result,$block);
	echo '</table>' . "\n";
}
?>
